package vule.color;

import java.awt.Color;
import java.util.Arrays;
import java.util.List;

public class LocalizedColor {

	public static final LocalizedColor RED = new LocalizedColor(Color.red, "CRVENA");
	public static final LocalizedColor BLUE = new LocalizedColor(Color.blue, "PLAVA");
	public static final LocalizedColor YELLOW = new LocalizedColor(Color.yellow, "ZUTA");
	public static final LocalizedColor GREEN = new LocalizedColor(Color.green, "ZELENA");
	public static final LocalizedColor ORANGE = new LocalizedColor(Color.orange, "NARANDZASTA");
	public static final LocalizedColor PURPLE = new LocalizedColor(new Color(102, 51, 153), "LJUBICASTA");
	
	static final List<LocalizedColor> COLORS = Arrays.asList(RED, BLUE, YELLOW, GREEN);
	
	private Color color;
	private String name;
	
	public LocalizedColor(Color color, String name) {
		this.color = color;
		this.name = name;
	}
	public Color getColor() {
		return color;
	}
	public String getName() {
		return name;
	}
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((color == null) ? 0 : color.hashCode());
		result = prime * result + ((name == null) ? 0 : name.hashCode());
		return result;
	}
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		LocalizedColor other = (LocalizedColor) obj;
		if (color == null) {
			if (other.color != null)
				return false;
		} else if (!color.equals(other.color))
			return false;
		if (name == null) {
			if (other.name != null)
				return false;
		} else if (!name.equals(other.name))
			return false;
		return true;
	}
	
}
